﻿namespace PublicModels.APIObjs;

/// <summary>
/// POI查询
/// </summary>
public class Place: APIObjBase
{
    public string? result_type { get; set; }

    public List<PoiResult>? results { get; set; }
}

public class Location
{
    public Location()
    {

    }

    public Location(double lng, double lat)
    {
        this.lng = lng;
        this.lat = lat;
    }

    public Location(Point point)
    {
        lng = point.Position.X;
        lat = point.Position.Y;
    }
    
    public double lng { get; set; }

    public double lat { get; set; }

    public Point ToPoint() => new (lng, lat);
}

public class PoiResult
{
    public string? name { get; set; }

    public Location? location { get; set; }

    public string? address { get; set; }

    public string? province { get; set; }

    public string? city { get; set; }

    public string? area { get; set; }

    public string? telephone { get; set; }

    public string? uid { get; set; }

    public string? street_id { get; set; }

}